﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RivetProject.Model
{
    [Serializable]
    public class Product
    {
        public string Name { get; set; }

        public string HMIName { get; set; }

        public int Length { get; set; }

        public string IdentyCode { get; set; }

        public string MaterialCode { get; set; }

        public int ProcessType { get; set; }

        public bool IsTask { get; set; }
        /// <summary>
        /// 是否进行MES过站校验
        /// </summary>
        public bool IsMESLoad { get; set; }
        /// <summary>
        /// 是否进行MES报工
        /// </summary>
        public bool IsMESReport { get; set; }
        /// <summary>
        /// 是否上传数据
        /// </summary>
        public bool IsDataUpload { get; set; }
        public Product()
        {
            Name = "";
            Length = 0;
            IdentyCode = "";
            HMIName = "";
            MaterialCode = "";
        }

        public bool Check(string value)
        {
            if (value.Length == Length && value.Contains(IdentyCode))
                return true;
            else 
                return false;
        }
    }
}
